package com.iraeta.mapper.sys;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iraeta.entity.User;
import com.iraeta.entity.UserRole;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper extends BaseMapper<User> {
    User selectUserByWxid(@Param("wxuid") String wxuid);
    List<User> listOrgUserByName(@Param("orgId") Integer orgId, @Param("name") String name);
    List<User> listUserByPermissionId(@Param("permissionId") Integer permissionId);       //查询还有某个权限的人员

    /*userRole  user set role*/
    int insertUserRole(UserRole record);
    UserRole selectByUserRole(@Param("userId") Integer userId, @Param("roleId") Integer roleId);
    void deleteUserRoleIdStr(@Param("userId") Integer userId, @Param("userRoleIdStr") String userRoleIdStr); //删除userId的 不在userRoleIdStr中的数据

    /*userRole role set user*/
    //role 选择用户用
    List<User> selectUserByRoleId(@Param("roleId") Integer roleId);

    /*user permission*/
    List<Integer> selectUserPermissions(@Param("userId") Integer userId);
}
